#function: build CentOS6 mysql5.1 server
#parmeter:
#author: yeslf
#version: 1.0
#Test:

FROM 172.27.1.200:5000/lchub/lccentos6:base
MAINTAINER yeslf yeslf@xxx.com


#install mysql
RUN yum install -y  initscripts mysql-server mysql-client mysql-devel;yum clean all ;\
mkdir -p /var/lock/subsys; mkdir /tmp ;chmod 777 /tmp;touch /etc/sysconfig/network;\
service mysqld start ;\
mysql -u root -e "CREATE USER 'mysqlroot'@'%' IDENTIFIED BY 'test123'";\
mysql -u root -e "CREATE USER 'mysqlroot'@'localhost' IDENTIFIED BY 'test123'";\
mysql -u root -e "CREATE USER 'mysqlroot'@'127.0.0.1' IDENTIFIED BY 'test123'";\
mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'mysqlroot'@'%' WITH GRANT OPTION"


EXPOSE 3306
CMD ["/usr/bin/mysqld_safe"]



